﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using DomainDriver.DomainModeling.DomainObjects;

namespace AutomotivePricingModel.Brands
{
    public partial class Brand : KeyedDomainObjectBase<Guid, Brand>
    {
        private Nullable<Guid> m_OwningCompany;
        private Nullable<Guid> m_CountryOfOrigin;
        private string m_Name;
        private Nullable<DateTime> m_BrandCreationDate;

        public Brand()
        {
            m_Key = Guid.NewGuid();
            m_OwningCompany = null;
            m_CountryOfOrigin = null;
            m_Name = string.Empty;
            m_BrandCreationDate = null;
        }

        public Nullable<Guid> OwningCompany
        {
            get { return m_OwningCompany; }
            set { m_OwningCompany = value; }
        }

        public Nullable<Guid> CountryOfOrigin
        {
            get { return m_CountryOfOrigin; }
            set { m_CountryOfOrigin = value; }
        }

        public string Name
        {
            get { return m_Name; }
            set { m_Name = value; }
        }

        public Nullable<DateTime> BrandCreationDate
        {
            get { return m_BrandCreationDate; }
            set { m_BrandCreationDate = value; }
        }

        #region DomainObject Methods

        public override Brand Copy()
        {
            Brand copy = new Brand();
            CopyTo(copy);
            return copy;
        }

        public override void CopyTo(Brand otherObject)
        {
            if (otherObject.m_Key != m_Key)
            { otherObject.m_Key = m_Key; }
            if (otherObject.m_OwningCompany != m_OwningCompany)
            { otherObject.m_OwningCompany = m_OwningCompany; }
            if (otherObject.m_CountryOfOrigin != m_CountryOfOrigin)
            { otherObject.m_CountryOfOrigin = m_CountryOfOrigin; }
            if (otherObject.m_Name != m_Name)
            { otherObject.m_Name = m_Name; }
            if (otherObject.m_BrandCreationDate != m_BrandCreationDate)
            { otherObject.m_BrandCreationDate = m_BrandCreationDate; }
        }

        public override bool Equals(Brand otherObject)
        {
            if (otherObject.m_Key != m_Key)
            { return false; }
            if (otherObject.m_OwningCompany != m_OwningCompany)
            { return false; }
            if (otherObject.m_CountryOfOrigin != m_CountryOfOrigin)
            { return false; }
            if (otherObject.m_Name != m_Name)
            { return false; }
            if (otherObject.m_BrandCreationDate != m_BrandCreationDate)
            { return false; }
            return true;
        }

        #endregion
    }
}